class Animal:
    def __init__(self, name="张三"):
        self._name = name

    def run(self):
        print("动物会跑")

    def sleep(self):
        print("动物睡觉")

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        self._name = name


class Dog(Animal):
    def bark(self):
        print("汪汪汪！")
    def run(self):
        print("狗刨")


if __name__ == '__main__':
    d=Dog("aaa")
    print(d.name)
    d.name="旺财"
    print(d.name)